{template 'common/header'}
<style>
    .stress_red
    {
        color: red;
    }
</style>
<div class="main">
    <ul class="nav nav-tabs">
        <li class="active" ><a href="{php echo $this->createWebUrl('log', array('op'=>'display'));}">抽奖记录</a></li>
    </ul>
    <div class="panel panel-info">
        <div class="panel-heading">
            <a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseOne" aria-expanded="true" aria-controls="collapseOne" style="color:#FFF;display:block;outline:none; color: #31708f">
                筛选条件 ↓
            </a>
        </div>
        <div id="collapseOne" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingOne">
            <div class="panel-body">
                <form action="" method="post" class="form-horizontal form" id="form">
                    <div class="form-group">
                        <div>
                            <label class="col-xs-12 col-sm-3 col-md-2 col-lg-2  control-label" >姓名</label>
                            <div class=" col-xs-12 col-sm-7 col-md-8 col-lg-8">
                                <input type="text" name="search[log_nickname]" value="{$search['log_nickname']}" placeholder="可模糊搜素" class="form-control">
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <div>
                            <label class="col-xs-12 col-sm-3 col-md-2 col-lg-2  control-label" >奖品</label>
                            <div class=" col-xs-12 col-sm-7 col-md-8 col-lg-8">
                                <input type="text" name="search[log_prize]" value="{$search['log_prize']}" placeholder="可模糊搜素" class="form-control">
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <div>
                            <label class="col-xs-12 col-sm-3 col-md-2 col-lg-2  control-label" >openid</label>
                            <div class=" col-xs-12 col-sm-7 col-md-8 col-lg-8">
                                <input type="text" name="search[log_openid]" value="{$search['log_openid']}"  class="form-control">
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <div>
                            <label class="col-xs-12 col-sm-3 col-md-2 col-lg-2  control-label" >状态</label>
                            <div class=" col-xs-12 col-sm-7 col-md-8 col-lg-8">
                                <select name="search[log_prizeid]" >
                                    <option value="">全部</option>
                                    <option value="1" {if $search['log_state'] == 1}selected{/if}>未发送</option>
                                    <option value="2" {if $search['log_state'] == 2}selected{/if}>已发送</option>

                                </select>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-2"></div>
                        <div class="col-sm-8">
                            <input name="submit" type="submit" value="查询" class="btn btn-primary" style="width:120px; margin-right: 30px;"/>
                            <input name="reset" type="button" value="清空" class="btn btn-default" style="width:120px;" onclick="formreset()"/>
                            <input type="hidden" name="token" value="{$_W['token']}" />
                            <input type="hidden" name="searchflag" value="1" />
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <div class="panel panel-info">
        <div class="panel-heading">投诉列表</div>
        <div class="panel-body">
            <div class="table-responsive panel-body">
                <table class="table table-hover table-responsive">
                    <thead class="navbar-inner">
                    <tr>
                        <th style="">排序</th>
                        <th style="">姓名</th>
                        <th style="">奖品</th>
                        <th style="">消耗积分</th>
                        <th style="">状态</th>
                        <th style="">时间</th>
                        <th style="">操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    {php $i = ($pindex - 1) * $psize + 1;}
                    {loop $logs $key $item}
                    <tr>
                        <td>{$i}</td>
                        <td>{$item['log_nickname']}</td>
                        <td>{$item['log_prize']}</td>
                        <td>消耗积分:{$item['log_credit1']}</td>
                        <td>
                            {if $item['log_blank'] == 2}<label class="label label-danger">未中奖</label>{else}{if $item['log_state'] == 1}<a onclick="if(!confirm('确定修改此状态为已发送?')) return false;" href="{php echo $this->createWebUrl('log', array('op'=>'putout', 'id'=>$item['log_id']))}" class="label label-default">未发送</a>{else}<label class="label label-info">已发送</label>{/if}{/if}</td>
                        <td>{$item['log_time_add']}</td>
                        <td>

                            <a onclick="if(!confirm('删除后将不可恢复,确定删除吗?')) return false;" class="btn btn-danger" href="{php echo $this->createWebUrl('log', array('op'=>'delete', 'id'=>$item['log_id']))}">删除</a>
                        </td>
                    </tr>
                    {php $i++;}
                    {/loop}
                    {if !empty($logs)}
                    <tr>
                        <td colspan="7">
                        </td>
                    </tr>
                    {else}
                    <tr>
                        <td colspan="7">
                            暂无抽奖记录
                        </td>
                    </tr>
                    {/if}
                    </tbody>
                </table>
                <div style="text-align:center;">{$page}</div>
            </div>
        </div>
    </div>
</div>
<script>
    function formreset()
    {
        $('.form-control').val("");
    };

</script>
{template 'common/footer'}